import request from '@/utils/request';

//登录
export async function login(data: any) {
  return request('/proxyapi/user/doLogin', {
    method: 'POST',
    data: data,
  });
}

//退出登录
export async function outLogin() {
  return request('/proxyapi/user/loginOut', {
    method: 'GET',
  });
}

//获取用户信息
export async function getUserInfo(params = {}) {
  return request('/proxyapi/user/getUserInfo', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

//设置密码
export async function updatePass(data: any) {
  return request('/proxyapi/user/updatePass', {
    method: 'POST',
    data: data,
  });
}

// 字典列表
export async function sysDictList(params: any) {
  return request('/proxyapi/sysDict/list', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

// 字典新增
export async function sysDictAdd(data: any) {
  return request('/proxyapi/sysDict/add', {
    method: 'POST',
    data: data,
  });
}

// 字典删除
export async function sysDictRemove(params: any) {
  return request('/proxyapi/sysDict/remove', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

// 字典更新
export async function sysDictUpdate(data: any) {
  return request('/proxyapi/sysDict/update', {
    method: 'POST',
    data: data,
  });
}

// 分区列表
export async function getScreenAreaList(params: any) {
  return request('/proxyapi/screenArea/list', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

// 分区更新
export async function updateScreenArea(data: any) {
  return request('/proxyapi/screenArea/update', {
    method: 'POST',
    data: data,
  });
}

// 区域绑定
export async function screenAreaBindDeviceOrPatient(data: any) {
  return request('/proxyapi/screenArea/bindDeviceOrPatient', {
    method: 'POST',
    data: data,
  });
}

// 区域解除绑定
export async function screenAreaUnbindDeviceOrPatient(data: any) {
  return request('/proxyapi/screenArea/unbindDeviceOrPatient', {
    method: 'POST',
    data: data,
  });
}

// 获取分区详情
export async function screenAreaInfo(params:any) {
  return request('/proxyapi/screenArea/info', {
    method: 'GET',
    params:{
        ...params
    }
  });
}

// 系统设置更新
export async function SystemSettingsUpdate(data: any) {
  return request('/proxyapi/SystemSettings/update', {
    method: 'POST',
    data: data,
  });
}
// 系统设置查询
export async function SystemSettingsGetInfo() {
  return request('/proxyapi/SystemSettings/getInfo', {
    method: 'GET',
  });
}